#include <stdio.h>
int main()
{
    int temp, max = 0, sum, i, n;
    int a[10] = {0};
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%d", &temp);
        if (temp == 0)
        {
            a[0]++;
            /* code */
        }
        while (temp > 0)//!!!
        {
            a[temp % 10]++;
            temp /= 10;
        }
    }
    max = a[0];
    for (i = 0; i < 10; i++)
    {
        if (max < a[i])
        {
            max = a[i];
            /* code */
        }
 
        /* code */
    }
    printf("%d:", max);
    for (i = 0; i < 10; i++)
    {
        if (max == a[i])
        {
            printf(" %d", i);
            /* code */
        }
        /* code */
    }
    return 0;
 
    /* code */
}
